/*河南星辰软件科技有限公司
@copyright Copyright (c) 2010~2022 All rights reserved.
*/
package cn.javaxc.system.action.system;
import java.io.*;
import java.util.*;
import java.sql.*;
import cn.javaxc.model.base.SQL;
import cn.javaxc.model.base.SQLList;
import cn.javaxc.model.base.SQLMap;
import cn.javaxc.model.base.SQLParam;
import cn.javaxc.model.page.BatisPage;
import cn.javaxc.mvcwork.controller.web.TreeBean;
import cn.javaxc.mvcwork.util.common.CommonUtil;
import cn.javaxc.mvcwork.util.common.MapListUtil;
import cn.javaxc.mvcwork.util.helper.FrameHelper;
import cn.javaxc.mvcwork.util.helper.TreeTableHelper;
import org.springframework.beans.factory.annotation.Autowired;
import cn.javaxc.system.action.base.BaseAction;
import cn.javaxc.system.mapper.system.AllSearchMapper;
public class AllSearch extends BaseAction
{
    @Autowired(required=false)
	private AllSearchMapper mapper;
    /**
    客户搜索
    */
    
    public Map customerSearch() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        SQLList<SQLMap> clientmode=mapper.clientmode(params);
        result.put("clientmode", clientmode);
        
        
        SQLList<SQLMap> clientorigin=mapper.clientorigin(params);
        result.put("clientorigin", clientorigin);
        
        
        SQLList<SQLMap> clientbus=mapper.clientbus(params);
        result.put("clientbus", clientbus);
        
        
        SQLList<SQLMap> s_province=mapper.s_province(params);
        result.put("s_province", s_province);
        
        
        params.def("address_province",-1);
        SQLList<SQLMap> s_city=mapper.s_city(params);
        result.put("s_city", s_city);
        
        
        params.def("address_city",-1);
        SQLList<SQLMap> s_district=mapper.s_district(params);
        result.put("s_district", s_district);
        
        
        result.put("s_search", pagination.getSearchParas());
        
        return result;
    }
    /**
    搜索结果
    */
    
    public Map customerSearchList() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        SQLList<SQLMap> s_user=mapper.s_user(params);
        result.put("s_user", s_user);
        
        
        SQLList<SQLMap> s_client=mapper.s_client(params,pagination);
        s_client.setPagedListInfo(pagination);
        result.put("s_client", s_client);
        
        return result;
    }
    /**
    报价与合同搜索
    */
    
    public Map contractSearch() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        result.put("s_search", pagination.getSearchParas());
        
        return result;
    }
    /**
    搜索结果
    */
    
    public Map contractSearchList() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        SQLList<SQLMap> s_quo_proce=mapper.s_quo_proce(params,pagination);
        s_quo_proce.setPagedListInfo(pagination);
        result.put("s_quo_proce", s_quo_proce);
        
        return result;
    }
    /**
    设备搜索
    */
    
    public Map devSearch() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        result.put("s_search", pagination.getSearchParas());
        
        return result;
    }
    /**
    搜索结果
    */
    
    public Map devSearchList() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        SQLList<SQLMap> s_device=mapper.s_device(params,pagination);
        s_device.setPagedListInfo(pagination);
        result.put("s_device", s_device);
        
        return result;
    }
    /**
    产品商品搜索
    */
    
    public Map productSearch() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        result.put("s_search", pagination.getSearchParas());
        
        return result;
    }
    /**
    搜索结果
    */
    
    public Map productSearchList() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        SQLList<SQLMap> s_info=mapper.s_info(params);
        result.put("s_info", s_info);
        
        return result;
    }
    public String ajaxComplete(){
        String sql="";
        String pagesql="";
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        if(request.getParameter("cfield_name").equals("s_client_name")){
            SQLList<SQLMap> s_client_name=mapper.s_client_name(params);
            request.setAttribute("s_client_name", s_client_name);
        }
        
        
        if(request.getParameter("cfield_name").equals("s_quo_theme")){
            SQLList<SQLMap> s_quo_theme=mapper.s_quo_theme(params);
            request.setAttribute("s_quo_theme", s_quo_theme);
        }
        
        
        if(request.getParameter("cfield_name").equals("s_produce_device")){
            SQLList<SQLMap> s_produce_device=mapper.s_produce_device(params);
            request.setAttribute("s_produce_device", s_produce_device);
        }
        
        
        if(request.getParameter("cfield_name").equals("s_product")){
            SQLList<SQLMap> s_product=mapper.s_product(params);
            request.setAttribute("s_product", s_product);
        }
        
        return AJAXCOMPLETE;
    }
}